package cn.miw.android.bdmp3.service;

import android.os.Handler;
import android.os.Message;
import android.telephony.PhoneStateListener;

public class MyPhoneCallListener extends PhoneStateListener {
	private Handler handler;

	public MyPhoneCallListener(Handler handler) {
		super();
		this.handler = handler;
	}

	@Override
	public void onCallStateChanged(int state, String incomingNumber) {
		Message msg = Message.obtain();
		msg.what = state;
		msg.obj = incomingNumber;
		handler.sendMessage(msg);
		super.onCallStateChanged(state, incomingNumber);
	}

}
